package com.blockmeta.bbs.businesslibrary.util;

import android.content.Context;

import com.blockmeta.bbs.baselibrary.utils.SharedPreferenceUtil;

/**
 * 用户相关的shareprefence保存
 */
public class UserSharedPreferenceUtil {


	public static void putString(Context context, String key, String value){
		SharedPreferenceUtil.putString(context, getUserKey(key), value);
	}

	private static String getUserKey(String key) {
		return AccountHelper.getUid() + "!!" + key;
	}

	public static String getString(Context context, String key,
			String defValue) {
		return SharedPreferenceUtil.getString(context, key, defValue);
	}

	public static void putInt(Context context, String key, int value) {
	    SharedPreferenceUtil.putInt(context, getUserKey(key), value);
	}

	public static int getInt(Context context, String key,
								   int defValue) {
		return SharedPreferenceUtil.getInt(context, getUserKey(key), defValue);
	}

	public static void putLong(Context context, String key, long value) {
	    SharedPreferenceUtil.putLong(context, getUserKey(key), value);
	}

	public static Long getLong(Context context, String key,
							 long defValue) {

		return SharedPreferenceUtil.getLong(context, getUserKey(key), defValue);
	}


	public static void remove(Context context, String key)
	{
	    SharedPreferenceUtil.remove(context, getUserKey(key));
	}
}
